<?php
	$form_add_emploi = array(
	 					'class' => 'plus_add_emploi',
	 					'id' => 'plus_form_div_emploi',
	 					'title' => lang('add_emploi')
	 				);
	echo anchor("etudiant_c/form_add_emploi",'<span class="ui-icon ui-icon-plusthick"></span>',$form_add_emploi);
?>
<?php if (empty($emplois))
	{
		echo sprintf(lang('noemploi'),$etudiant->GMET_NOM,$etudiant->GMET_PRENOM);
	}
?>
<?php $i=0;?>
<div id="div_add_emploi" class="info_ancien">
	<?php
		$lab = array('class' => 'label');
		echo form_open('etudiant_c/add_emploi');
		echo form_hidden('GMET_CODE',$etudiant->GMET_CODE);
		echo '<div class="input_enblobant">';
		$order_emp =array(
		        			'1' => '1',
		        			'2' => '2',
		        			'3' => '3',
		        			'4' => '4',
		        			'5' => '5',
		        			'6' => '6',
		        			'7' => '7',
		        			'8' => '8',
		        			'9' => '9',
		        			'10' => '10'
		        	);
		echo '<span class="div_left" id="div_num_emploi">'.form_label(lang('numero_emploi'),'GMEM_NUMERO_ORDRE',$lab).' '.form_dropdown('GMEM_NUMERO_ORDRE',$order_emp).'</span>';
		$yes = array(
	    'name'        => 'GMEM_ACTUEL',
	    'value'       => '1'
	    );

		$no = array(
	    'name'        => 'GMEM_ACTUEL',
	    'value'       => '0',
	    'checked'	=> TRUE
	    );
		echo '<span class="div_right" id="div_act_emploi">'.form_label(lang('actuel_emploi'),'GMEM_ACTUEL',$lab).' '.lang('yes').form_radio($yes).' '.lang('no').form_radio($no).'</span></div>';

		$date_deb = array(
                              'id' => 'datepicker_deb',
                              'name' => 'GMEM_DATE_EMBAUCHE',
                              'value' => ''
                              );
		echo '<div class="input_enblobant"><span class="div_left" id="div_date_deb">'.form_label(lang('date_deb'),'GMEM_DATE_EMBAUCHE',$lab).' '.form_input($date_deb).'</span>';

		$date_fin = array(
                              'id' => 'datepicker_fin',
                              'name' => 'GMEM_DATE_FIN',
                              'value' => ''
                              );
		echo '<span class="div_right" id="div_date_fin">'.form_label(lang('date_fin'),'GMEM_DATE_FIN',$lab).' '.form_input($date_fin).'</span>';
        echo '</div>';



        echo '<div class="input_enblobant">';
		$fonc_emp =array(
		        			'name' => 'GMEM_FONCTION'
		        	);
		echo '<span class="div_left" id="div_fonction">'.form_label(lang('fonction'),'GMEM_FONCTION',$lab).' '.form_input($fonc_emp).'</span>';
		$ent_name_emp =array(
		        			'name' => 'GMEM_NOM_ENTREPRISE',
		        			'class' => 'majuscule'
		        	);
		echo '<span class="div_right" id="div_nom_entreprise">'.form_label(lang('nom_entreprise'),'GMEM_NOM_ENTREPRISE',$lab).' '.form_input($ent_name_emp).'</span>';
		echo '</div>';
		$sal_emp =array(
		        			'name' => 'GMEM_SALAIRE_ANNUEL'
		        	);
		echo '<div class="input_enblobant"><span class="div_left" id="div_salaire">'.form_label(lang('salaire'),'GMEM_SALAIRE_ANNUEL',$lab).' '.form_input($sal_emp).'</span>';
		$type_cont_emp =array(
								'CDI' => lang('CDI'),
								'CDD' => lang('CDD'),
								'CDDOD' => lang('CDDOD'),
								'CA' => lang('CA'),
								'CAA' => lang('CAA'),
								'CP' => lang('CP'),
								'CTI' => lang('CTI'),
								'CTT' => lang('CTT'),
								'CDDS' => lang('CDDS'),
								'CUI-CAE' => lang('CUI-CAE'),
								'CUI-CIE' => lang('CUI-CIE'),
								'CV' => lang('CV'),
								'Autres' => lang('Autres')
							);
		echo '<span class="div_right" id="div_type_contrat">'.form_label(lang('type_contrat'),'GMEM_TYPE_CONTRAT',$lab).' '.form_dropdown('GMEM_TYPE_CONTRAT',$type_cont_emp).'</span>';
        echo '</div>';



		echo '<div class="input_enblobant">';
		$tel_emp =array(
		        			'name' => 'GMEM_TELEPHONE'
		        	);
		echo '<span class="div_left" id="div_tel_emploi">'.form_label(lang('tel_emploi'),'GMEM_TELEPHONE',$lab).' '.form_input($tel_emp).'</span>';
		$mail_emp =array(
		        			'name' => 'GMEM_EMAIL'
		        	);
		echo '<span class="div_right" id="div_email_emploi">'.form_label(lang('email_emploi'),'GMEM_EMAIL',$lab).' '.form_input($mail_emp).'</span>';
        echo '</div>';




        echo '<div class="input_enblobant">';
		$adr_emp =array(
		        			'name' => 'GMEM_ADRESSE'
		        	);
		echo '<span class="div_left" id="div_adr_emploi">'.form_label(lang('adr_emploi'),'GMEM_ADRESSE',$lab).' '.form_input($adr_emp).'</span>';
        echo '</div>';



        echo '<div id="div_cp_ville_pays" class="input_enblobant">';
		$cp_emp =array(
		        			'name' => 'GMEM_CODE_POSTAL'
		        	);
		echo '<span id="div_cp_emploi">'.form_label(lang('cp_emploi'),'GMEM_CODE_POSTAL',$lab).' '.form_input($cp_emp).'</span>';
		$ville_emp =array(
		        			'name' => 'GMEM_VILLE',
		        			'class' => 'capital'
		        	);
		echo '<span class="div_right" id="div_ville_emploi">'.form_label(lang('ville_emploi'),'GMEM_VILLE',$lab).' '.form_input($ville_emp).'</span>';
		$pays_emp =array(
		        			'name' => 'GMEM_PAYS',
		        			'class' => 'majuscule'
		        	);
		echo '<span id="div_pays_emploi">'.form_label(lang('pays_emploi'),'GMEM_PAYS',$lab).' '.form_input($pays_emp).'</span>';
        echo '</div>';
        echo '<div class="div_right">'.form_submit('mysubmit', lang('add_emploi')).'</div>';
		echo form_close();
	?>
</div>
<?php foreach ($emplois as $emploi):?>
	<?php $i++;?>
	<div id = "info_emploi_<?php echo $i; ?>" class="info_ancien emploi_class">
		<?php echo form_open('etudiant_c/edit_profilepic');?>
			<?php echo form_hidden('GMEM_CODE',$emploi->GMEM_CODE);?>
			<span>
				<?php
					$edit_emploi = array(
					 					'class' => 'link a_edit_emploi',
					 					'title' => sprintf(lang('editemploi'),$emploi->GMEM_NUMERO_ORDRE,$etudiant->GMET_NOM,$etudiant->GMET_PRENOM)
					 				);
					echo anchor("etudiant_c/form_edit_emploi",'<span class="ui-icon ui-icon-pencil pencil_emploi"></span>',$edit_emploi);
					$delet_emploi = array(
					 					'class' => 'link a_delete_emploi',
					 					'title' => sprintf(lang('deleteemploi'),$emploi->GMEM_NUMERO_ORDRE,$etudiant->GMET_NOM,$etudiant->GMET_PRENOM)
					 				);
					echo anchor("etudiant_c/delete_emploi",'<span class="ui-icon ui-icon-trash trash_emploi"></span>',$delet_emploi);
				?>
			</span>
			<?php echo '<p><span class="label">'.sprintf(lang('number_emploi'),$emploi->GMEM_NUMERO_ORDRE).'</span>';
				if($emploi->GMEM_ACTUEL==1)
				{
					echo '<span class="label minuscule">('.lang('actuel_emploi').')</span>';
				}
				echo '<span>'.sprintf(lang('date_emploi'),$emploi->GMEM_DATE_EMBAUCHE,$emploi->GMEM_DATE_FIN).'</span></p>';
			?>
			<?php echo '<div><p><span class="label"><span class="majuscule">'.$emploi->GMEM_FONCTION.'</span> '.sprintf(lang('type_contrat_salaire'),$emploi->GMEM_TYPE_CONTRAT,$emploi->GMEM_SALAIRE_ANNUEL).'</span>';
				echo '</p></div>';
			?>
			<?php echo '<div>';
				echo '<p><span class="label">'.lang('nom_entreprise').'</span><span class="contenu_span majuscule">'.$emploi->GMEM_NOM_ENTREPRISE.'</span>';
				echo '<span class="label">'.lang('tel_emploi').'</span><span class="contenu_span">'.$emploi->GMEM_TELEPHONE.'</span>';
				echo '<span class="label">'.lang('email_emploi').'</span><span class="contenu_span">'.$emploi->GMEM_EMAIL.'</span></p>';
				echo '<p><span class="label">'.lang('adr_emploi').'</span><div id="adr"><p class="contenu_span">'.$emploi->GMEM_ADRESSE.'</p><p class="contenu_span">'.$emploi->GMEM_CODE_POSTAL.' <span class="capital">'.$emploi->GMEM_VILLE.'</span></p><p class="contenu_span"><span class="majuscule">'.$emploi->GMEM_PAYS.'</span></p></div></p>';
				echo '</div>';
			?>
		<?php echo form_close(); ?>
	</div>
<?php endforeach?>